//
//  Space.m
//  ipadclient
//
//  Created by Stéphane Prohaszka on 03/06/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import "Space.h"


@implementation Space

@synthesize totalViews;

- (id) init {
    self = [super init];
    
    if (self) {
        totalViews = 0;
    }
    
    return self;
}

- (id) initWithJson:(NSDictionary*)jsonObject {
    self = [super initWithJson:jsonObject];
    
    if (self) {
        totalViews = [[jsonObject objectForKey:@"totalViews"] intValue];
    }
    
    return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder {
    self = [super initWithCoder:aDecoder];
    
    if (self) {
        totalViews = [aDecoder decodeIntForKey:@"totalViews"];
    }
    
    return self;
}

- (void)dealloc {
    [super dealloc]; 
}

- (id)copyWithZone:(NSZone *)zone {
    Space* copy = [super copyWithZone:zone];
    copy.totalViews = self.totalViews;
    
    return copy;
}

- (void)encodeWithCoder:(NSCoder *)aCoder {
	[super encodeWithCoder:aCoder];
	[aCoder encodeInt:totalViews forKey:@"totalViews"];
}

@end
